<?php

class IndexController extends Zend_Controller_Action
{

    public function init()
    {
    	
    }

    public function indexAction()
    {
    	$this->_redirect ('/photo/list');
    }
    
    //http://localhost/trombino/public/index.php/index/toto
    public function totoAction()
    {
    	$this->view->title = "toto test";
    	
    	$db = new Model_DbTable_Flux_DocTypes();
    	
    	$arr = $db->getAll();
    	
    	$this->view->data = $arr;
    
    	
    }
    
    public function ecrireAction()
    {
    	$auteur = $this->_getParam('auteur', 0);
    	$raison = $this->_getParam('raison', 0);
    	$heure = "maintenant";//new DateTime();
    	 
    	$dbU = new Model_DbTable_Flux_Uti();
    	$idU = $dbU->ajouter(array("login"=>$auteur));
    	 
    	$dbT = new Model_DbTable_Flux_Tag();
    	$idT = $dbT->ajouter(array("code"=>$raison,"desc"=>"raison"));
    	 
    	$dbUT = new Model_DbTable_flux_utitag();
    	$dbUT->ajouter(array("uti_id"=>$idU, "tag_id"=>$idT, "poids"=> new Zend_Db_Expr('NOW()')));
    	 
    	$this->view->data = $idU." ".$idT." ".$heure;
    }

}



